<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<form method="POST" action="/">
{{ csrf_field() }}
<input type="text" name="name" id="name" placeholder="名字" required autofocus>
<input type="text" name="mrp_code" id="mrp_code" placeholder="推荐码(选填)" autofocus>
@include('error')
<button>注册</button>

</form>

<hr style="margin-top: 200px">
<form method="GET" action="/">
    <input type="text" name="id" id="id" placeholder="获取某ID的本身和子集"  autofocus>
    <button>搜索</button>
</form>

<ul>
    @foreach ($users as $user)
        <li>（id:{{ $user->id }}) {{ $user->name }}--（推荐码：{{ $user->mrp_code }}）</li>
        <ul>
            @foreach ($user->childrenUsers as $childrenUser)
                @include('child_user', ['child_user' => $childrenUser])
            @endforeach
        </ul>
    @endforeach
</ul>


</body>
</html>
